<?php
use tpfcore\Core;
?>
<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<!-- Set render engine for 360 browser -->
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<!-- HTML5 shim for IE8 support of HTML5 elements -->
		<!--[if lt IE 9]>
			<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js">
			</script>
		<![endif]-->
		<link href="{$admin_assets_path}/css/theme.min.css" rel="stylesheet">
		<link href="{$admin_assets_path}/css/simplebootadmin.css" rel="stylesheet">
		<link href="{$admin_assets_path}/css/default.css" rel="stylesheet" />
		<link href="{$admin_assets_path}/css/font-awesome.min.css" rel="stylesheet" type="text/css">
		<style>
			.length_3{width: 180px;} form .input-order{margin-bottom: 0px;padding:3px;width:40px;}
			.table-actions{margin-top: 5px; margin-bottom: 5px;padding:0px;} .table-list{margin-bottom:
			0px;}
		</style>
		<!--[if IE 7]>
			<link rel="stylesheet" href="{$admin_assets_path}/css/font-awesome-ie7.min.css">
		<![endif]-->
		<script type="text/javascript">
			//全局变量
			var GV = {
				WEB_ROOT:"",
				DIMAUB: "/",
				JS_ROOT: "/theme/backend/assets/js/",
				TOKEN: ""
			};
		</script>
		<!-- Le javascript==================================================-
		-> <!-- Placed at the end of the document so the pages load faster -->
		<script src="{$admin_assets_path}/js/jquery.js"></script>
		<script src="{$admin_assets_path}/js/wind.js"></script>
		<script src="{$admin_assets_path}/js/bootstrap.min.js"></script>
		<link href="{$admin_assets_path}/kindeditor/themes/default/default.css" rel="stylesheet"/>
		<script src="{$admin_assets_path}/kindeditor/kindeditor-min.js"></script>
		<script>
			var editor;
			KindEditor.ready(function(K) {
				var uploadbutton = K.uploadbutton({
					button : K('#uploadButton')[0],
					fieldName : 'imgFile',
					url : "{:url('cms/posts/upload')}",
					afterUpload : function(data) {
						if (data.code === 0) {
							var url = K.formatUrl(data.data[0], 'absolute');
							K('#url').val(url);
							$('#show_thumb').attr('src',url).show();
						} else {
							alert(data.msg);
						}
					},
					afterError : function(str) {
						alert('错误信息已打印到控制台');
						console.log(str);
					}
					});
					uploadbutton.fileBox.change(function(e) {
					uploadbutton.submit();
				});
			});
		</script>
	</head>
	<body>
		<div class="wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:url('cms/posts/auto_submit',['type'=>'baidu'])}">百度提交配置</a></li>
		</ul>
		<form method="post" class="form-horizontal js-ajax-form" action="">
			<fieldset>
			<div class=""> 
			<table class="table table-bordered"> 
			<tbody>
			<tr>
				<th>是否自动提交</th>
				<td>
					{empty name="config.isauto_submit"}
					<label><input type="radio" name="isauto_submit" value="0" checked/> 否</label>
					<label><input type="radio" name="isauto_submit" value="1"/> 是</label>
					{else/}
					<label><input type="radio" name="isauto_submit" value="0" {eq name="config.isauto_submit" value="0" }checked{/eq}/> 否</label>
					<label><input type="radio" name="isauto_submit" value="1" {eq name="config.isauto_submit" value="1" }checked{/eq}/> 是</label>
					{/empty}
					<span class="form-required">自动提交将在成功添加文章后自动提交到百度，若文章不须要进一步审核或其它处理，可进行自动提交，否则请关闭</span> 
				</td> 
			</tr>
			<tr> 
				<th width="80">链接规则</th>
				<td>
					{empty name="config.url"}
					<input type="text" style="width: 400px;" name="url" value='{"url":"frontend/Posts/show","param":{"id":"$id"}}' placeholder="请填写要提交的链接规则"> 
					{else/}
					<input type="text" style="width: 400px;" name="url" value= '{$config.url}' placeholder="请填写要提交的链接规则"> 
					{/empty}
					<span class="form-required">*请填写要提交的链接规则,默认为{"url":"frontend/Posts/show","param":{"id":"$id"}},其中$id表示文章id</span> 
				</td> 
			</tr>
			<tr>
				<th>秘钥</th> 
				<td>
					<input type="text" style="width: 400px;" name="token" value="{$config.token|default=''}" placeholder="请输入密钥"><span class="form-required"> *在搜索资源平台申请的推送用的准入密钥</span> 
				</td> 
			</tr>
			<tr> 
				<th width="80">被推送站点</th> 
				<td> 
					<input type="text" style="width: 400px;" name="site" value="{$config.site|default=''}" placeholder="请输入被推送站点完成域名"> <span class="form-required">不写默认为frontend模板对应的域名</span> 
				</td> 
			</tr>
			</tbody>
			</table> 
			</div>
			</fieldset>
			<div class="form-actions">
				<button class="btn btn-primary js-ajax-button" type="button">确定操作</button>
				<a class="btn" href="javascript:history.back(-1);">返回</a>
			</div>
		</form>
	</div>
	<script src="{$admin_assets_path}/js/common.js"></script>
	</body>

</html>